package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the CUSTOMER_CREDIT_NOTES database table.
 * 
 */
@Entity
@Table(name="CUSTOMER_CREDIT_NOTES")
@NamedQueries({
    @NamedQuery(name = "CustomerCreditNote.findAll", query = " SELECT c FROM CustomerCreditNote c "),
    @NamedQuery(name = "CustomerCreditNote.findById", query = " SELECT c FROM CustomerCreditNote c WHERE c.id = :Id "),
    @NamedQuery(name = "CustomerCreditNote.findByStatus", query = " SELECT c FROM CustomerCreditNote c WHERE c.syncIssync = 'N' And c.status = :status"),
})
public class CustomerCreditNote extends jpa.entitys.common.CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private CustomerCreditNotePK id;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="ADDRESS_CODE", precision=2)
	private BigDecimal addressCode;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREDIT_NOTE_DATE")
	private Date creditNoteDate;

	@Column(length=3)
	private String currency;

	@Column(name="CUSTOMER_CODE", length=30)
	private String customerCode;

	@Column(name="CUSTOMER_NAME", length=100)
	private String customerName;

	@Column(name="DEPARTMENT_CODE", length=30)
	private String departmentCode;

	@Column(name="EXCHANGE_RATE", precision=12, scale=8)
	private BigDecimal exchangeRate;

	@Column(name="FLAG_CANCEL_INV", length=1)
	private String flagCancelInv;

	@Column(name="INVOICE_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal invoiceCreditAmount;

	@Column(name="LAST_UPD_BY") 
	private String lastUpdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LAST_UPD_ON")
	private Date lastUpdOn;

	@Column(name="LINK_FILE_ID", precision=5)
	private BigDecimal linkFileId;

	@Column(name="NET_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal netCreditAmount;

	@Column(name="NET_CREDIT_LOCAL", precision=16, scale=2)
	private BigDecimal netCreditLocal;

	@Column(length=30)
	private String project;

	@Column(length=300)
	private String remarks;

	@Column(length=1)
	private String status;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_EXTERNAL_REF_KEY", length=100)
	private String syncExternalRefKey;

	@Column(name="SYNC_EXTERNAL_REF_NO", length=100)
	private String syncExternalRefNo;

	@Column(name="SYNC_ISSTAGING", length=1)
	private String syncIsstaging;

	@Column(name="SYNC_ISSYNC", length=1)
	private String syncIssync;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(name="UNADJUSTED_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal unadjustedCreditAmount;

	@Column(name="VAT_CODE", length=2)
	private String vatCode;

	@Column(name="VAT_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal vatCreditAmount;

	//bi-directional many-to-one association to CustCrnoteInvoiceReference
	@OneToMany(mappedBy="customerCreditNote")
	private Set<CustCrnoteInvoiceReference> custCrnoteInvoiceReferences;
	
	@Column(name="IS_INTERFACE")
	private String isInterface;

	public String getIsInterface() {
		return isInterface;
	}

	public void setIsInterface(String isInterface) {
		this.isInterface = isInterface;
	}

    public CustomerCreditNote() {
    }

	public CustomerCreditNotePK getId() {
		return this.id;
	}

	public void setId(CustomerCreditNotePK id) {
		this.id = id;
	}
	
	public BigDecimal getAddressCode() {
		return this.addressCode;
	}

	public void setAddressCode(BigDecimal addressCode) {
		this.addressCode = addressCode;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public Date getCreditNoteDate() {
		return this.creditNoteDate;
	}

	public void setCreditNoteDate(Date creditNoteDate) {
		this.creditNoteDate = creditNoteDate;
	}

	public String getCurrency() {
		return this.currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String getCustomerCode() {
		return this.customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public String getCustomerName() {
		return this.customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getDepartmentCode() {
		return this.departmentCode;
	}

	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}

	public BigDecimal getExchangeRate() {
		return this.exchangeRate;
	}

	public void setExchangeRate(BigDecimal exchangeRate) {
		this.exchangeRate = exchangeRate;
	}

	public String getFlagCancelInv() {
		return this.flagCancelInv;
	}

	public void setFlagCancelInv(String flagCancelInv) {
		this.flagCancelInv = flagCancelInv;
	}

	public BigDecimal getInvoiceCreditAmount() {
		return this.invoiceCreditAmount;
	}

	public void setInvoiceCreditAmount(BigDecimal invoiceCreditAmount) {
		this.invoiceCreditAmount = invoiceCreditAmount;
	}

	public String getLastUpdBy() {
		return this.lastUpdBy;
	}

	public void setLastUpdBy(String lastUpdBy) {
		this.lastUpdBy = lastUpdBy;
	}

	public Date getLastUpdOn() {
		return this.lastUpdOn;
	}

	public void setLastUpdOn(Date lastUpdOn) {
		this.lastUpdOn = lastUpdOn;
	}

	public BigDecimal getLinkFileId() {
		return this.linkFileId;
	}

	public void setLinkFileId(BigDecimal linkFileId) {
		this.linkFileId = linkFileId;
	}

	public BigDecimal getNetCreditAmount() {
		return this.netCreditAmount;
	}

	public void setNetCreditAmount(BigDecimal netCreditAmount) {
		this.netCreditAmount = netCreditAmount;
	}

	public BigDecimal getNetCreditLocal() {
		return this.netCreditLocal;
	}

	public void setNetCreditLocal(BigDecimal netCreditLocal) {
		this.netCreditLocal = netCreditLocal;
	}

	public String getProject() {
		return this.project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncExternalRefKey() {
		return this.syncExternalRefKey;
	}

	public void setSyncExternalRefKey(String syncExternalRefKey) {
		this.syncExternalRefKey = syncExternalRefKey;
	}

	public String getSyncExternalRefNo() {
		return this.syncExternalRefNo;
	}

	public void setSyncExternalRefNo(String syncExternalRefNo) {
		this.syncExternalRefNo = syncExternalRefNo;
	}

	public String getSyncIsstaging() {
		return this.syncIsstaging;
	}

	public void setSyncIsstaging(String syncIsstaging) {
		this.syncIsstaging = syncIsstaging;
	}

	public String getSyncIssync() {
		return this.syncIssync;
	}

	public void setSyncIssync(String syncIssync) {
		this.syncIssync = syncIssync;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public BigDecimal getUnadjustedCreditAmount() {
		return this.unadjustedCreditAmount;
	}

	public void setUnadjustedCreditAmount(BigDecimal unadjustedCreditAmount) {
		this.unadjustedCreditAmount = unadjustedCreditAmount;
	}

	public String getVatCode() {
		return this.vatCode;
	}

	public void setVatCode(String vatCode) {
		this.vatCode = vatCode;
	}

	public BigDecimal getVatCreditAmount() {
		return this.vatCreditAmount;
	}

	public void setVatCreditAmount(BigDecimal vatCreditAmount) {
		this.vatCreditAmount = vatCreditAmount;
	}

	public Set<CustCrnoteInvoiceReference> getCustCrnoteInvoiceReferences() {
		return this.custCrnoteInvoiceReferences;
	}

	public void setCustCrnoteInvoiceReferences(Set<CustCrnoteInvoiceReference> custCrnoteInvoiceReferences) {
		this.custCrnoteInvoiceReferences = custCrnoteInvoiceReferences;
	}
	
}